package neu.soft.mapper;

import neu.soft.entity.EntryOrder;
import neu.soft.entity.GoodInfo;
import neu.soft.entity.OperationPurchaseOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Mapper
public interface EntryOrderMapper {
    /**
     * 生成一条入库单
     * @author zhh
     * @param map
     * @return
     */
    void addEntryOrder(Map<String,Object> map);

    /**
     * 根据所给条件查询入库单
     * @author zhh
     * @param map
     * @return
     */
    List<Map<String,Object>> queryEntryOrder(Map<String,Object> map);

    /**
     * 查询所有的入库单和其中包含的商品
     * @author zhh
     * @return
     */
    List<Map<String,Object>> showAllEntryOrder(Map<String,Object> map);

    /**
     * 根据所给条件查询行数，在showAll时只需传pagesize和pagenow，在条件查询时可传其他属性
     * @author zhh
     * @param map
     * @return
     */
    Long getEntryRows(Map<String,Object> map);

    /**
     * 根据所给的入库单号删除入库单,同时删除对应的货物记录
     * @author zhh
     * @param map
     */
    void deleteEntryOrder(Map<String,Object> map);

    void batchInsertGoodInfo(List<GoodInfo> goodInfoList);

    List<Map<String,Object>> queryGoodInfo(int goodOrderId);

    String queryOrderIdByPurchase(int purchaseOrderId);

    void addPurchaseOrder(OperationPurchaseOrder purchaseOrder);

    int existEntryOrder(String entryOrderId);
}
